package fun.chutianshu.controller;

import fun.chutianshu.entity.Userinfo;
import fun.chutianshu.service.UserinfoService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 用户表(Userinfo)表控制层
 *
 * @author makejava
 * @since 2021-04-06 10:37:39
 */
@RestController
@RequestMapping("userinfo")
public class UserinfoController {
    /**
     * 服务对象
     */
    @Resource
    private UserinfoService userinfoService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    // http://127.0.0.1:8080/userinfo/selectOne/1
    @GetMapping("selectOne/{id}")
    public Userinfo selectOne(Long id) {
        return this.userinfoService.queryById(id);
    }

}